
function create_conn() {
    var userId = $$('#userId').val();
    if(userId.length == 0){
        tips('请输入一个用户id')
        return;
    }
    join_server(userId);
}

function send() {
    var message = $$('#sendMessage').val();
    sendMessage(message);
}
function toAll() {
    log(msgObject);
}
function toMe() {
    log(msgObject);
    log(parseInt(msgObject.toId) == parseInt($$('#userId').val()));
    if(parseInt(msgObject.toId) == parseInt($$('#userId').val())){
        var obj = '['+JSON.stringify(msgObject)+']';
        obj = eval('(' + obj + ')');
        initTemplate('#message-template','#list-message',obj,1);
    }
}